Magnets are used in consumer products and in particular, electronic devices, in many ways to enhance a user experience. By way of example, magnets can be used to hold a lid of a laptop shut, to connect a case to an electronic device, or for retaining a device charger to an electronic device among numerous other applications. With the ubiquity of electronic devices, using magnets in a greater number of applications is a growing consideration and the ability to control magnetization of a magnet when desired can lead to a greater number of desirable applications.